#ifndef __BRUSH_H__
#define __BRUSH_H__

#include <cocos2d.h>
#include "gofgame/common/Ref.h"

namespace gofgame {
	namespace common {
		namespace graphics {

			using namespace cocos2d;

			class Brush : public CCObject {
			public:
				virtual bool isTransparent() const = 0;
				void fillRect(float left, float top, float width, float height);
				void fillRect(const CCRect &rect);

				static Brush *transparent();
				static Brush *black();
				static Brush *white();
				static bool isSimpleBrush(Brush *brush);
				static void checkIsSimpleBrush(Brush *brush, const char *brushName = nullptr);

			protected:
				Brush();
				virtual void onFillRect(float left, float top, float width, float height) = 0;

			private:
				static Ref<Brush> transparentBrush;
				static Ref<Brush> blackBrush;
				static Ref<Brush> whiteBrush;
			};
		}
	}
}

#endif //__BRUSH_H__
